package com.ruicar.afs.cloud.image.service;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruicar.afs.cloud.common.rules.dto.RuleRunResult;
import com.ruicar.afs.cloud.image.condition.AuditCondition;
import com.ruicar.afs.cloud.image.entity.ComAttachmentFile;
import com.ruicar.afs.cloud.image.entity.ComAttachmentManagement;
import com.ruicar.afs.cloud.image.vo.AuditFileVo;

import java.util.List;

/**
 * @Description:
 * @Author: fangchenliang
 * @Date: 2020/5/15 20:06
 */
public interface ComAttaManageService extends IService<ComAttachmentManagement> {
    /**
     * @Description:获取需要展示的影像件列表
     * @Author: fangchenliang
     * @Date: 2020/6/1 11:41
     * @Param:List
     * @Return: List
     */
    public List<ComAttachmentManagement> getUploadList(JSONObject runParams, List<ComAttachmentManagement> AllComAttachmentManagementList);

    /**
     * @Description:解析影像类型下所配置的规则
     * @Author: fangchenliang
     * @Date: 2020/6/1 11:44
     * @Param: [comAttachmentManagement]
     * @Return: com.ruicar.afs.cloud.image.entity.ComAttachmentManagement
     */
    public RuleRunResult resolveRule(JSONObject runParams, ComAttachmentManagement comAttachmentManagement);

    /**
     * @Description:
     * @Author: fangchenliang
     * @Date: 2020/6/4 18:28
     * @Param: [comAttachmentManagement, applyNo]
     * @Return: com.ruicar.afs.cloud.image.entity.ComAttachmentManagement
     */
    public ComAttachmentManagement CollectFileInfo(ComAttachmentManagement comAttachmentManagement, String applyNo);

    /**
     * @Description:
     * @Author: fangchenliang
     * @Date: 2020/6/6 10:24
     * @Param: [runParams, busiType]
     * @Return: java.util.List<com.ruicar.afs.cloud.image.entity.ComAttachmentManagement>
     */
    public List<ComAttachmentManagement> getAttaListByRule(JSONObject runParams, String busiType);

    /**
     * @Description:
     * @Author: fangchenliang
     * @Date: 2020/6/6 15:32
     * @Param: [busiNo, busiType]
     * @Return: java.util.List<com.ruicar.afs.cloud.image.entity.ComAttachmentManagement>
     */
    public List<ComAttachmentManagement> getAllFileList(String busiNo, String busiType);

    /**
     * @Description:
     * @Author: fangchenliang
     * @Date: 2020/6/6 15:44
     * @Param: [runParams, comAttachmentManagement]
     * @Return: com.ruicar.afs.cloud.image.entity.ComAttachmentManagement
     */
    public ComAttachmentManagement comAttachmentManagementHitRule(JSONObject runParams, ComAttachmentManagement comAttachmentManagement);

    /**
     * @Description:
     * @Author: fangchenliang
     * @Date: 2020/6/6 17:01
     * @Param: [list]
     * @Return: java.util.List<com.ruicar.afs.cloud.image.entity.ComAttachmentManagement>
     */
    public List<ComAttachmentManagement> invokeParent(List<ComAttachmentManagement> list);

    /**
     * @param title
     * @Description: 模糊搜索
     * @Author: tianaki
     * * @return list
     */
    List<ComAttachmentManagement> findByAttachmentName(String title);

    /**
     * @Description:规则组获取影像类型
     * @Author: fangchenliang
     * @Date: 2020/7/23 20:12
     * @Param: [runParams, groupId]
     * @Return: java.util.List<com.ruicar.afs.cloud.image.entity.ComAttachmentManagement>
     */
    List<ComAttachmentManagement> getManagementByRuleGroup(JSONObject runParams, String groupId);

    /**
     * @Description:通过唯一标识获取文件信息
     * @Author: fangchenliang
     * @Date: 2020/8/17 14:01
     * @Param:
     * @Return: 
     */
    ComAttachmentFile getFile(String uniqueCode, String busiNo);

    List<ComAttachmentFile> getFileList(List<ComAttachmentFile> fileList,String busiNo,String belongNo,ComAttachmentManagement comAttachmentManagement,String version);

    /**
     * 放款审核文件内容
     * @param auditCondition
     * @return
     */
    List<AuditFileVo> getLoanAllFileList(AuditCondition auditCondition);

    /**
     * 根据唯一表示查询文件
     */
    List<AuditFileVo> getFileByUniqueCode(String uniqueCodes,String busiNo,String belongNo);

    /**放款修改文件版本号，以及新文件状态*/
    void updateFileVersionByBusiNoForLoan(String contractNo,List<String> attachmentIdList);

    /**修改文件状态为合格状态*/

    void setFileStandard(String contractNo,String attachmentCode);

    /**
     *还款人身份证合成
     */
    void mergeRepayIdCard(String contractNo,String accountName,String certNo);

    /**
     *还款银行卡合成
     */
    void mergeRepayBankCard(String contractNo,String accountName,String accountNo);
}
